package top.stacktrace.account.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.stacktrace.account.domain.LoginVo;
import top.stacktrace.account.domain.User;
import top.stacktrace.account.service.AccountService;

@RestController
public class AccountController {
    @Autowired
    private AccountService accountService;

    @PostMapping("/checklogin")
    public User checkLogin(@RequestBody LoginVo v){
        return accountService.login(v);
    }

    @GetMapping("/pay")
    public boolean pay(@RequestParam long userid,@RequestParam int n){
        return accountService.pay(userid,n);
    }
}
